package com.lerning.edu.manage.test;

import com.lerning.edu.commons.util.DateUtil;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;

/**
 * @author jiangwei
 * @since 18/8/8
 */
public class test {

    public static void main(String[] args) {
//        System.out.println(Math.ceil(12.3));//向上取整
//
//        System.out.println(DateUtil.dateToWeek("2018-08-09 17:04:37.610"));
//
//        System.out.println(autoGenericCode("1",4));

        Map map = new HashMap<>();
        map.put("a",1);
        map.put("a",2);

        System.out.println( DateUtil.getLastDateStrN(3));

    }

    public static   String autoGenericCode(String code, int num) {
        String result = "";
        // 保留num的位数
        // 0 代表前面补充0
        // num 代表长度为4
        // d 代表参数为正数型
        result = String.format("%0" + num + "d", Integer.parseInt("0002") + 1);

        System.out.println("|14D10F0F-0C58-4270-A1C8-5C64B3C5C03E|".replace("|",""));

        String strDate = "2018-08-30";
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.formateStringToDate(strDate));//设置起时间
        cal.add(Calendar.MONTH, 1);//增加一个月


        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");

        System.out.println(sf.format(cal.getTime()));

        String aa = "123456";
        System.out.println(aa.substring(1,aa.length()));

        System.out.println( DateUtil.getLastDateStrN(3));

        return result;
    }
}
